from django.conf.urls.defaults import *
from aggregator.feeds import CommunityAggregatorFeed
from aggregator.models import FeedItem
from django.contrib import admin
from django.conf import settings

admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^cloutster/', include('cloutster.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Have webalizer?
    #url(r'^admin/webalizer/', include('webalizer.urls')),

    # Uncomment the next line to enable the admin:
     (r'^admin/(.*)', admin.site.root),
     (r'^chicago/', include('chicago.urls')),
     url(r'^rep/(?P<slug>[\w-]+)/$', 
          'repsheet.views.rep_detail',
          name='repsheet_rep_detail',),
     url(r'^about/$', 
         'django.views.generic.simple.direct_to_template', 
         {'template': 'about.html'},
         name="repsheet_about"),
     url(r'^widgets/$', 
         'django.views.generic.simple.direct_to_template', 
         {'template': 'widgets.html'},
         name="repsheet_widgets"),
     url(r'^widgets/300_basic/$', 
         'django.views.generic.simple.direct_to_template', 
         {'template': 'widgets_300_basic.html'},
         name="repsheet_widgets_300_basic"),
     url(r'^widgets/300_sleek/$', 
         'django.views.generic.simple.direct_to_template', 
         {'template': 'widgets_300_sleek.html'},
         name="repsheet_widgets_300_sleek"),
     url(r'^$', 
         'repsheet.views.lookup',
         name='repsheet_lookup',),
     url(r'^(?P<slug>[\w-]+)/$', 
         'repsheet.views.detail',
         name='repsheet_detail',),
     url(r'^(?P<slug>[\w-]+)/(?P<rss>rss)/$', 
         'repsheet.views.detail',
         name='repsheet_detail_rss',),
     url(r'^(?P<slug>[\w-]+)/sub/$', 
         'repsheet.views.subscribe',
         name='repsheet_subscribe',),
)

# Use django static view for development
print settings.MEDIA_ROOT
if settings.DEBUG:
    urlpatterns += patterns('',
        ( 
            r'^media/(?P<path>.*)$', 
            'django.views.static.serve', 
            {'document_root': settings.MEDIA_ROOT}),    
        )
